package com.plian.system.wrapper.hr.hrbackup;

import com.plian.Tools.DateUtil;
import com.plian.system.dto.hr.staff.TechnicalQualificationDTO;
import com.plian.system.dto.hr.staffBackup.TechnicalQualificationOldDTO;
import com.plian.system.entity.hr.staff.TechnicalQualification;
import com.plian.system.entity.hr.staffAnnualBackup.TechnicalQualificationOld;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.hr.staff.TechnicalQualificationVO;
import com.plian.system.vo.hr.staffAnnualBackup.TechnicalQualificationOldVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.DICT_CODE_TO_NAME;
import static com.plian.system.wrapper.util.WrapperConstant.SPRING;

/**
 * 专业技术资格包装类,返回视图层所需的字段
 *
 * @author gangan
 * @since 2019-09-30
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface TechnicalQualificationOldWrapper extends BaseWrapper<TechnicalQualificationOld, TechnicalQualificationOldDTO, TechnicalQualificationOldVO> {

	@Override
	@Mappings(value = {
			@Mapping(source = "technicalTitleLevelId", target = "technicalTitleLevelName" , qualifiedByName = DICT_CODE_TO_NAME),
			@Mapping(source = "buildDate", target = "buildDateStr", dateFormat = DateUtil.PATTERN_MONTH)
	})
	TechnicalQualificationOldVO entityToVO(TechnicalQualificationOld entity);
}
